<?php

$dest = isset($_GET['dest']) ? trim($_GET['dest']) : baseUrl() . '/';

$lang = isset($_GET['code']) ? trim($_GET['code']) : 'vn';

if ($lang !== 'en') {
    $lang = 'vn';
}

setcookie('lang', $lang, time() + 365*24*60*60, '/');

header('Location: ' . $dest);

exit;

?>
